﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace 招聘网站
{
    public partial class Form6 : Form
    {
        public static string i;
        public Form6()
        {
            InitializeComponent();
        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void label11_Click(object sender, EventArgs e)
        {

        }

        private void groupBox2_Enter(object sender, EventArgs e)
        {
           
        }

        private void Form6_Load(object sender, EventArgs e)
        {
            toolStripStatusLabel2.Text = "时间:" + DateTime.Now.ToLongTimeString();
            toolStripStatusLabel1.Text = "日期:" + DateTime.Now.ToShortDateString();

            string sqlStr = "server=.;database=zhaopin;integrated security=SSPI";
            SqlConnection con = new SqlConnection(sqlStr);
            con.Open();
            string selectsql = string.Format("Select * from table_2 ", con);
            SqlCommand com = new SqlCommand(selectsql, con);
            com.CommandType = CommandType.Text;
            SqlDataReader sdr;
            sdr = com.ExecuteReader();
            while (sdr.Read())
            {
                if (Form2.a==sdr["phonenumb"].ToString().Trim())
                {
                    i  = sdr["name"].ToString().Trim ();
                    label1.Text = sdr["name"].ToString();
                    label2.Text = sdr["sex"].ToString();
                    label3.Text = sdr["born"].ToString();
                    label4.Text = sdr["city"].ToString();
                    label7.Text = sdr["phonenumb"].ToString();
                    label8.Text = sdr["email"].ToString();
                }
            }
            sdr.Close();
            con.Close();
        
        
           con.Open();
           string select = string.Format("Select * from table_3 ", con);
           SqlCommand comm = new SqlCommand(select, con);
            SqlDataReader sdrr;
            sdrr = comm.ExecuteReader();
          
            while (sdrr.Read())
            {
                
                if (Form2.a == sdrr["phonenumb"].ToString().Trim())
                {
                    label10.Text = sdrr["jingyan"].ToString();
                    label12.Text = sdrr["xuewei"].ToString();
                    label14.Text = sdrr["school"].ToString();
                    label16.Text = sdrr["gzxingzhi"].ToString();
                    label18.Text = sdrr["cszhiye"].ToString();
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("是否退出本系统？", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                Application.Exit();
            else
            {
                Form6 f6 = new Form6();
                f6.Show();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form8 f8 = new Form8();
            f8.Show();
            this.Hide();

        }

        private void label7_Click(object sender, EventArgs e)
        {

        }

        private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }
    }
}
